const Mock = require('mockjs')
const baseApi = process.env.VUE_APP_BASE_API

Mock.setup({
  timeout: 300
})

// 路由权限
Mock.mock(baseApi + '/getRouters', 'get', {
  "msg": "操作成功",
  "code": 200,
  "data": [
    {
      "name": "Assets",
      "path": "/assets",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "白蚁监测",
        "icon": "list",
        "noCache": false,
        "link": null
      },
      "children": [
        {
          "name": "Asset",
          "path": "asset",
          "hidden": false,
          "component": "manage/asset/index",
          "meta": {
            "title": "蚁情管理",
            "icon": "documentation",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Task",
          "path": "task",
          "hidden": false,
          "component": "manage/task/index",
          "meta": {
            "title": "设备管理",
            "icon": "drag",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "AssetChange",
          "path": "assetChange",
          "hidden": true,
          "component": "manage/assetChange/index",
          "meta": {
            "title": "资产变更记录",
            "icon": "documentation",
            "noCache": false,
            "link": null
          }
        }
      ]
    },
    {
      "name": "Information",
      "path": "/information",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "信息管理",
        "icon": "chart",
        "noCache": false,
        "link": null
      },
      "children": [
        {
          "name": "Department",
          "path": "department",
          "hidden": false,
          "component": "manage/department/index",
          "meta": {
            "title": "部门信息",
            "icon": "cascader",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Personnel",
          "path": "personnel",
          "hidden": false,
          "component": "manage/personnel/index",
          "meta": {
            "title": "人员信息",
            "icon": "people",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Addressbook",
          "path": "addressbook",
          "hidden": false,
          "component": "system/user/addressBook",
          "meta": {
            "title": "通讯录",
            "icon": "cascader",
            "noCache": false,
            "link": null
          }
        }
      ]
    },
    {
      "name": "Internal",
      "path": "/internal",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "账号管理",
        "icon": "example",
        "noCache": false,
        "link": null
      },
      "children": [
        {
          "name": "User",
          "path": "user",
          "hidden": false,
          "component": "system/user/index",
          "meta": {
            "title": "用户管理",
            "icon": "user",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Fields",
          "path": "fields",
          "hidden": false,
          "component": "manage/fields/index",
          "meta": {
            "title": "打印字段",
            "icon": "dashboard",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Dept",
          "path": "dept",
          "hidden": false,
          "component": "system/dept/index",
          "meta": {
            "title": "单位管理",
            "icon": "tree",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Role",
          "path": "role",
          "hidden": false,
          "component": "system/role/index",
          "meta": {
            "title": "权限管理",
            "icon": "peoples",
            "noCache": false,
            "link": null
          }
        }
      ]
    },
    {
      "name": "System",
      "path": "/system",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "系统设置",
        "icon": "system",
        "noCache": false,
        "link": null
      },
      "children": [
        {
          "name": "Position",
          "path": "position",
          "hidden": false,
          "component": "manage/position/index",
          "meta": {
            "title": "打印位置",
            "icon": "date-range",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Menu",
          "path": "menu",
          "hidden": false,
          "component": "system/menu/index",
          "meta": {
            "title": "菜单管理",
            "icon": "tree-table",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Post",
          "path": "post",
          "hidden": false,
          "component": "system/post/index",
          "meta": {
            "title": "岗位管理",
            "icon": "post",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Dict",
          "path": "dict",
          "hidden": false,
          "component": "system/dict/index",
          "meta": {
            "title": "字典管理",
            "icon": "dict",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Config",
          "path": "config",
          "hidden": false,
          "component": "system/config/index",
          "meta": {
            "title": "参数设置",
            "icon": "edit",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Notice",
          "path": "notice",
          "hidden": false,
          "component": "system/notice/index",
          "meta": {
            "title": "通知公告",
            "icon": "message",
            "noCache": false,
            "link": null
          }
        },
        {
          "name": "Log",
          "path": "log",
          "hidden": false,
          "redirect": "noRedirect",
          "component": "ParentView",
          "alwaysShow": true,
          "meta": {
            "title": "日志管理",
            "icon": "log",
            "noCache": false,
            "link": null
          },
          "children": [
            {
              "name": "Operlog",
              "path": "operlog",
              "hidden": false,
              "component": "monitor/operlog/index",
              "meta": {
                "title": "操作日志",
                "icon": "form",
                "noCache": false,
                "link": null
              }
            },
            {
              "name": "Logininfor",
              "path": "logininfor",
              "hidden": false,
              "component": "monitor/logininfor/index",
              "meta": {
                "title": "登录日志",
                "icon": "logininfor",
                "noCache": false,
                "link": null
              }
            }
          ]
        }
      ]
    },
  ]
})

// 登陆
Mock.mock(baseApi + '/login', 'post', { "msg": "操作成功", "code": 200, "token": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImYxMTQ2ODk0LThhMzMtNGEyNC1hMTBiLTIwZmY1Zjk3ZDI3ZSJ9.6MZNYroB6F4dJeJIw4EtOeAcTOFFMx_gzoAcInOraQXow4xq5prh4T_qxlryAOXxuRbZ57RFu7PS--FXBt0iZQ" })

// 登出
Mock.mock(baseApi + '/logout', 'post', { "msg": "操作成功", "code": 200 })

// 用户信息
Mock.mock(baseApi + '/getInfo', 'get', { "msg": "操作成功", "code": 200, "permissions": ["*:*:*"], "roles": ["admin"], "user": { "createBy": "admin", "createTime": "2023-09-27 15:27:36", "updateBy": null, "updateTime": null, "remark": "管理员", "params": { "@type": "java.util.HashMap" }, "userId": 1, "deptId": 103, "userName": "admin", "nickName": "青蒙", "email": "ll@163.com", "phonenumber": "15888888888", "sex": "0", "avatar": "", "password": "$2a$10$OgfbhYQs0EPHdw48UVB3oe8D.PO3s5KPzemxDNguyplRa6lbjDLJu", "status": "0", "delFlag": "0", "loginIp": "127.0.0.1", "loginDate": "2024-01-02T16:12:50.000+08:00", "dept": { "createBy": null, "createTime": null, "updateBy": null, "updateTime": null, "remark": null, "params": { "@type": "java.util.HashMap" }, "deptId": 103, "parentId": 101, "ancestors": "0,100,101", "deptName": "研发部门", "orderNum": 1, "leader": "若依", "phone": null, "email": null, "status": "0", "delFlag": null, "unitType": null, "parentName": null, "children": [] }, "roles": [{ "createBy": null, "createTime": null, "updateBy": null, "updateTime": null, "remark": null, "params": { "@type": "java.util.HashMap" }, "roleId": 1, "roleName": "超级管理员", "roleKey": "admin", "roleSort": 1, "dataScope": "1", "menuCheckStrictly": false, "deptCheckStrictly": false, "status": "0", "delFlag": null, "flag": false, "menuIds": null, "deptIds": null, "permissions": null, "admin": true }, { "createBy": null, "createTime": null, "updateBy": null, "updateTime": null, "remark": null, "params": { "@type": "java.util.HashMap" }, "roleId": 2, "roleName": "数据比对角色", "roleKey": "common", "roleSort": 20, "dataScope": "5", "menuCheckStrictly": false, "deptCheckStrictly": false, "status": "0", "delFlag": null, "flag": false, "menuIds": null, "deptIds": null, "permissions": null, "admin": false }], "roleIds": null, "postIds": null, "roleId": null, "admin": true } })

// 首页图表
Mock.mock(baseApi + '/manage/index/statistics', 'get', { "msg": "操作成功", "code": 200, "data": { "personnelNumber": "575", "assetNumber": "44407", "assetOriginalValue": "529970112.54", "taskNumber": "48" } })

// 系统管理，角色列表
// Mock.mock('/kjt-serve/v1/role/list', 'get', {"success":true,"message":"执行成功","data":[{"roleId":"307484825c414a70a83557889660691c","roleName":"开放","roleSign":"dashboard","isSystem":false,"status":1,"createTime":"2020-02-07 13:22:20","createBy":"15757101092","updateTime":"2020-02-07 13:22:57","updateBy":"15757101092","remarks":null,"isDelete":false,"menuList":null},{"roleId":"d2b46d4d0a7e4f598035384e6c7dffba","roleName":"管理员","roleSign":"admin","isSystem":false,"status":1,"createTime":"2019-11-26 09:16:56","createBy":"15757101092","updateTime":"2019-11-26 09:29:43","updateBy":"15757101092","remarks":"123","isDelete":false,"menuList":null},{"roleId":"f52e3ae96a5e454987410c7ba687ace8","roleName":"超级管理员","roleSign":"SuperAdmin","isSystem":true,"status":1,"createTime":"2019-11-22 10:32:58","createBy":null,"updateTime":"2019-12-13 10:10:11","updateBy":"15757101092","remarks":"最高级管理权限","isDelete":false,"menuList":null}],"code":200})

// 系统管理，角色树形菜单
// Mock.mock('/kjt-serve/v1/menu/list', 'get', {"success":true,"message":"执行成功","data":[{"menuId":"934cc7d600724a63b54a9c85cae99bb6","parentId":"super","menuType":null,"menuCode":"dashboard","menuName":"首页","sort":1,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:14:56","gmtModify":"2019-11-25 11:34:00","childMenus":[]},{"menuId":"cc7a560795d346edbe810874a1b084c6","parentId":"super","menuType":null,"menuCode":"assetDataCenter","menuName":"资产数据资源中心","sort":2,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:15:08","gmtModify":"2019-11-25 11:34:12","childMenus":[]},{"menuId":"1f07d223de934a4abe7793fd2fd0884d","parentId":"super","menuType":null,"menuCode":"assetCardManage","menuName":"资产卡片管理","sort":3,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:17:11","gmtModify":"2019-11-25 11:34:53","childMenus":[{"menuId":"b4169ead3a904fce8da7065ab008186e","parentId":"1f07d223de934a4abe7793fd2fd0884d","menuType":null,"menuCode":"instrument","menuName":"资产卡片建档","sort":4,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:17:27","gmtModify":"2019-11-25 11:34:57","childMenus":[]},{"menuId":"ddf8af26b6ae40b7ae2d24f748c3bd4d","parentId":"1f07d223de934a4abe7793fd2fd0884d","menuType":null,"menuCode":"testingItems","menuName":"资产卡片定位","sort":5,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:17:38","gmtModify":"2020-03-11 07:47:28","childMenus":[]}]},{"menuId":"43f92e11addc401190cc40824c848cd5","parentId":"super","menuType":null,"menuCode":"assetWorkManage","menuName":"资产业务管理","sort":6,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:17:48","gmtModify":"2019-11-25 11:35:09","childMenus":[{"menuId":"3f37cb56a53e4297ad82a3e3ba1222bf","parentId":"43f92e11addc401190cc40824c848cd5","menuType":null,"menuCode":"equipScrapping","menuName":"设备报废","sort":7,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:18:16","gmtModify":"2019-11-25 11:35:13","childMenus":[]},{"menuId":"3993e43c468d40baa0a209a5cec6045a","parentId":"43f92e11addc401190cc40824c848cd5","menuType":null,"menuCode":"equipMaintain","menuName":"设备维修","sort":8,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:18:26","gmtModify":"2019-11-25 11:35:15","childMenus":[]}]},{"menuId":"3bb6d803fe6a45cca54dba9fa1264e1f","parentId":"super","menuType":null,"menuCode":"assetInventtory","menuName":"资产盘点管理","sort":9,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:18:30","gmtModify":"2019-11-25 11:44:41","childMenus":[]},{"menuId":"eb3bab6864af4be78eebf1d56eff4de9","parentId":"super","menuType":null,"menuCode":"assetform","menuName":"资产统计报表","sort":10,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:18:41","gmtModify":"2019-11-25 11:35:18","childMenus":[{"menuId":"98ee7abcd867424ba2dae876821ea647","parentId":"eb3bab6864af4be78eebf1d56eff4de9","menuType":null,"menuCode":"allview","menuName":"总视图","sort":11,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:19:30","gmtModify":"2019-11-25 11:35:20","childMenus":[]},{"menuId":"497e53d7c4fc4c63af838ae9b37c0230","parentId":"eb3bab6864af4be78eebf1d56eff4de9","menuType":null,"menuCode":"taskStatistics","menuName":"任务单统计查询","sort":12,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:19:40","gmtModify":"2019-11-25 11:35:21","childMenus":[]}]},{"menuId":"c4b04c15cb094bde93b53511b4098aad","parentId":"super","menuType":null,"menuCode":"assetIOT","menuName":"RFID动态管理","sort":13,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:19:43","gmtModify":"2020-02-04 07:59:52","childMenus":[]},{"menuId":"79a62e61daaf42e1b43c7a3f5492620b","parentId":"super","menuType":null,"menuCode":"systemManage","menuName":"系统管理","sort":14,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:19:50","gmtModify":"2019-11-25 11:35:24","childMenus":[{"menuId":"bb2e1af2019d4b7ebe99a0a34b685946","parentId":"79a62e61daaf42e1b43c7a3f5492620b","menuType":null,"menuCode":"operationLog","menuName":"操作日志","sort":15,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:19:56","gmtModify":"2019-11-25 11:35:26","childMenus":[]},{"menuId":"55534411db81491086cb5e69925866aa","parentId":"79a62e61daaf42e1b43c7a3f5492620b","menuType":null,"menuCode":"notice","menuName":"通知查看","sort":16,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:03","gmtModify":"2019-11-25 11:35:28","childMenus":[]}]},{"menuId":"8ce0f0e7f61b48b5a02b6a2ad702de70","parentId":"super","menuType":null,"menuCode":"user","menuName":"用户管理","sort":17,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:09","gmtModify":"2019-11-25 11:35:29","childMenus":[{"menuId":"49180ebb116242189daff3047f7a7662","parentId":"8ce0f0e7f61b48b5a02b6a2ad702de70","menuType":null,"menuCode":"role","menuName":"角色权限管理","sort":18,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:16","gmtModify":"2019-11-25 11:35:32","childMenus":[]},{"menuId":"a9d2aaafb76a4d9b84505a7bd0172c29","parentId":"8ce0f0e7f61b48b5a02b6a2ad702de70","menuType":null,"menuCode":"userList","menuName":"用户管理","sort":19,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:24","gmtModify":"2019-11-25 11:35:34","childMenus":[]}]},{"menuId":"89cc7f2f4d4c4698ab7db1e83b87339c","parentId":"super","menuType":null,"menuCode":"account","menuName":"个人页","sort":20,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:31","gmtModify":"2019-11-25 11:35:36","childMenus":[{"menuId":"6592314f1d4b40b39862aec1c6d5bbec","parentId":"89cc7f2f4d4c4698ab7db1e83b87339c","menuType":null,"menuCode":"center","menuName":"个人中心","sort":21,"href":null,"icon":"","status":true,"isDelete":false,"gmtCreate":"2019-11-25 11:20:38","gmtModify":"2019-11-25 11:35:38","childMenus":[]}]}],"code":200})